<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改公告内容')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-content-edit">
			<input id="typeId" name="contentId" type="hidden" th:value="${content.contentId}"/>

			<div class="form-group">
				<div class="form-group">
					<label class="col-sm-3 control-label"> 公告类型的名称：</label>
					<!--				这里通过select 标签显示 公告类型 页面传送过来

 										th:selected= true 就是设置选中 指定的option
					 -->
					<div class="col-sm-9">
						<select class="form-control" name="typeId">
							<option th:each="type:${opts}" th:value="${type.typeId}" th:selected="${type.typeId eq content.typeId}" >
								<!--                            <span th:text="${type.typeName}"></span>-->
								[[${type.typeName}]]
							</option>
						</select>
					</div>
				</div>
			</div>

			<div class="form-group">

				<label class="col-sm-3 control-label">公告内容的标题：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="contentTitle" id="contentTitle" th:value="${content.contentTitle}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">公告内容:</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="contentText" id="contentText" th:value="${content.contentText}" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="remark" class="form-control">[[${content.remark}]]</textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "cms/content";
		
		$("#form-content-edit").validate({
			onkeyup: false,
			rules:{
			},
			messages: {
		    },
		    focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#form-content-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
